<!DOCTYPE html><html><head>
      <title>OS-expt_faq</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      
      <link rel="stylesheet" href="file:////Users/roamwonder/.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.3/node_modules/@shd101wyy/mume/dependencies/katex/katex.min.css">
      
      

      
      
      
      
      
      
      

      <style>
      /**
 * prism.js Github theme based on GitHub's theme.
 * @author Sam Clarke
 */
code[class*="language-"],
pre[class*="language-"] {
  color: #333;
  background: none;
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.4;

  -moz-tab-size: 8;
  -o-tab-size: 8;
  tab-size: 8;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
  padding: .8em;
  overflow: auto;
  /* border: 1px solid #ddd; */
  border-radius: 3px;
  /* background: #fff; */
  background: #f5f5f5;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: .1em;
  border-radius: .3em;
  white-space: normal;
  background: #f5f5f5;
}

.token.comment,
.token.blockquote {
  color: #969896;
}

.token.cdata {
  color: #183691;
}

.token.doctype,
.token.punctuation,
.token.variable,
.token.macro.property {
  color: #333;
}

.token.operator,
.token.important,
.token.keyword,
.token.rule,
.token.builtin {
  color: #a71d5d;
}

.token.string,
.token.url,
.token.regex,
.token.attr-value {
  color: #183691;
}

.token.property,
.token.number,
.token.boolean,
.token.entity,
.token.atrule,
.token.constant,
.token.symbol,
.token.command,
.token.code {
  color: #0086b3;
}

.token.tag,
.token.selector,
.token.prolog {
  color: #63a35c;
}

.token.function,
.token.namespace,
.token.pseudo-element,
.token.class,
.token.class-name,
.token.pseudo-class,
.token.id,
.token.url-reference .token.variable,
.token.attr-name {
  color: #795da3;
}

.token.entity {
  cursor: help;
}

.token.title,
.token.title .token.punctuation {
  font-weight: bold;
  color: #1d3e81;
}

.token.list {
  color: #ed6a43;
}

.token.inserted {
  background-color: #eaffea;
  color: #55a532;
}

.token.deleted {
  background-color: #ffecec;
  color: #bd2c00;
}

.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}


/* JSON */
.language-json .token.property {
  color: #183691;
}

.language-markup .token.tag .token.punctuation {
  color: #333;
}

/* CSS */
code.language-css,
.language-css .token.function {
  color: #0086b3;
}

/* YAML */
.language-yaml .token.atrule {
  color: #63a35c;
}

code.language-yaml {
  color: #183691;
}

/* Ruby */
.language-ruby .token.function {
  color: #333;
}

/* Markdown */
.language-markdown .token.url {
  color: #795da3;
}

/* Makefile */
.language-makefile .token.symbol {
  color: #795da3;
}

.language-makefile .token.variable {
  color: #183691;
}

.language-makefile .token.builtin {
  color: #0086b3;
}

/* Bash */
.language-bash .token.keyword {
  color: #0086b3;
}

/* highlight */
pre[data-line] {
  position: relative;
  padding: 1em 0 1em 3em;
}
pre[data-line] .line-highlight-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  background-color: transparent;
  display: block;
  width: 100%;
}

pre[data-line] .line-highlight {
  position: absolute;
  left: 0;
  right: 0;
  padding: inherit 0;
  margin-top: 1em;
  background: hsla(24, 20%, 50%,.08);
  background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
  pointer-events: none;
  line-height: inherit;
  white-space: pre;
}

pre[data-line] .line-highlight:before, 
pre[data-line] .line-highlight[data-end]:after {
  content: attr(data-start);
  position: absolute;
  top: .4em;
  left: .6em;
  min-width: 1em;
  padding: 0 .5em;
  background-color: hsla(24, 20%, 50%,.4);
  color: hsl(24, 20%, 95%);
  font: bold 65%/1.5 sans-serif;
  text-align: center;
  vertical-align: .3em;
  border-radius: 999px;
  text-shadow: none;
  box-shadow: 0 1px white;
}

pre[data-line] .line-highlight[data-end]:after {
  content: attr(data-end);
  top: auto;
  bottom: .4em;
}html body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ul,html body>ol{margin-bottom:16px}html body ul,html body ol{padding-left:2em}html body ul.no-list,html body ol.no-list{padding:0;list-style-type:none}html body ul ul,html body ul ol,html body ol ol,html body ol ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:bold;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em !important;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::before,html body code::after{letter-spacing:-0.2em;content:"\00a0"}html body pre>code{padding:0;margin:0;font-size:.85em !important;word-break:normal;white-space:pre;background:transparent;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;font-size:.85em !important;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:before,html body pre tt:before,html body pre code:after,html body pre tt:after{content:normal}html body p,html body blockquote,html body ul,html body ol,html body dl,html body pre{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body pre,html body code{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview .pagebreak,.markdown-preview .newpage{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center !important}.markdown-preview:not([for="preview"]) .code-chunk .btn-group{display:none}.markdown-preview:not([for="preview"]) .code-chunk .status{display:none}.markdown-preview:not([for="preview"]) .code-chunk .output-div{margin-bottom:16px}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{font-size:14px !important;padding:1em}}@media print{html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,0.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{padding:0 1.6em;margin-top:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc li{margin-bottom:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{list-style-type:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% -  300px);padding:2em calc(50% - 457px -  150px);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
h1 {
  font-size: 24px !important;
  text-align: center;
  border-bottom: 8px double;
}
h2 {
  font-size: 22px !important;
  border-bottom: 3px dashed;
}
h3 {
  font-size: 20px !important;
  border-bottom: 2px dashed;
}
h4 {
  font-size: 18px !important;
  border-bottom: 1px dashed;
}
h5 {
  font-size: 16px !important;
  border-bottom: 1px dotted;
}
h6 {
  font-size: 16px !important;
  border-bottom: 1px dotted;
}
body {
  font-size: 14px !important;
  counter-reset: h1counter;
}
.footnote-item {
  font-size: 14px !important;
}
hr {
  display: block;
  height: 0px !important;
  border: 0;
  border-top: 4px solid SlateGray !important;
  margin: 1em 0;
  padding: 0;
}
h1 {
  counter-reset: h2counter;
}
h2 {
  counter-reset: h3counter;
  counter-increment: h2counter;
}
h3 {
  counter-reset: h4counter;
  counter-increment: h3counter;
}
h4 {
  counter-reset: h5counter;
  counter-increment: h4counter;
}
h5 {
  counter-reset: h6counter;
  counter-increment: h5counter;
}
h6 {
  counter-increment: h6counter;
}
h2:before {
  content: counter(h2counter, decimal-leading-zero) ".\0000a0\0000a0";
}
h3:before {
  content: counter(h2counter, decimal-leading-zero) "." counter(h3counter, decimal-leading-zero) ".\0000a0\0000a0";
}
h4:before {
  content: counter(h2counter, decimal-leading-zero) "." counter(h3counter, decimal-leading-zero) "." counter(h4counter, decimal-leading-zero) ".\0000a0\0000a0";
}
h5:before {
  content: counter(h2counter, decimal-leading-zero) "." counter(h3counter, decimal-leading-zero) "." counter(h4counter, decimal-leading-zero) "." counter(h5counter, decimal-leading-zero) ".\0000a0\0000a0";
}
h6:before {
  content: counter(h2counter, decimal-leading-zero) "." counter(h3counter, decimal-leading-zero) "." counter(h4counter, decimal-leading-zero) "." counter(h5counter, decimal-leading-zero) "." counter(h6counter, decimal-leading-zero) ".\0000a0\0000a0";
}
ol {
  list-style-type: decimal-leading-zero;
}
.center_div {
  margin: auto;
  display: block;
  overflow: auto;
}
.attention,
.note_it {
  border: 2px dashed #007AAA;
  padding: 5px;
  font-weight: bold;
}
.note_it {
  text-align: center;
}
.bold_and_red {
  font-weight: bold;
  color: red;
}
.bold_and_blue {
  font-weight: bold;
  color: blue;
}
/*
.slides {
  // This will modify all slides.
}
.slides > section:nth-child(1) {
  // This will modify `the first slide`.
  //background-color: blue;
}
*/
/*
code {
    white-space:pre-wrap;
    white-space:-moz-pre-wrap;
    white-space:-pre-wrap;
    white-space:-o-pre-wrap;
    word-wrap:break-word;
}
*/
section * {
  font-family: "PingFang SC", "Courier New", Courier, monospace !important;
}
section h1 {
  font-size: 46px !important;
  font-weight: bolder !important;
  color: DarkGreen !important;
  text-transform: none !important;
  /*
    text-shadow: 0 1px 0 #ccc,
        0 2px 0 #c9c9c9,
        0 3px 0 #bbb,
        0 4px 0 #b9b9b9,
        0 5px 0 #aaa,
        0 6px 1px rgba(0, 0, 0, 0.1),
        0 0 5px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 3px 5px rgba(0, 0, 0, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.25),
        0 20px 20px rgba(0, 0, 0, 0.15) !important;
        */
}
section h2 {
  font-size: 34px !important;
  font-weight: bolder !important;
  color: Teal !important;
  margin-top: 0.5em !important;
  text-transform: none !important;
  /*
    text-shadow: 0 1px 0 #ccc,
        0 2px 0 #c9c9c9,
        0 3px 0 #bbb,
        0 4px 0 #b9b9b9,
        0 5px 0 #aaa,
        0 6px 1px rgba(0, 0, 0, 0.1),
        0 0 5px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 3px 5px rgba(0, 0, 0, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.25),
        0 20px 20px rgba(0, 0, 0, 0.15) !important;
        */
}
section h3 {
  font-size: 32px !important;
  font-weight: bolder !important;
  text-transform: none !important;
  /*
    text-shadow: rgba(0, 0, 0, 0.3) 0px 2px 6px !important;
    */
  font-family: 'Courier New', Courier, monospace !important;
}
section h2:before,
section h3::before,
section h4::before {
  content: none;
}
section {
  font-size: 32px !important;
}
.left_align {
  text-align: left !important;
}
section blockquote {
  font-size: 30px !important;
  font-family: 'Courier New', Courier, monospace !important;
  font-weight: bolder !important;
  text-align: left !important;
  width: 98% !important;
  line-height: 120% !important;
  color: #007AAA;
  border: dashed 2px #007AAA !important;
}
section blockquote li {
  font-style: normal !important;
}
section blockquote strong {
  color: darkgreen;
}
section pre {
  font-size: 26px !important;
  line-height: 120% !important;
}
section p {
  font-family: 'Courier New', Courier, monospace !important;
  font-style: normal !important;
  font-weight: normal !important;
}
section h1 + p img {
  max-height: 500px !important;
}
section h2 + p img {
  max-height: 500px !important;
}

      </style>
    </head>
    <body for="html-export">
      <div class="mume markdown-preview  ">
      <h1 class="mume-header" id="os-experiment-faq">OS  Experiment FAQ</h1>

<div class="code-chunk" data-id="code-chunk-id-0" data-cmd="toc"><div class="input-div"><div class="btn-group"><div class="run-btn btn"><span>&#x25B6;&#xFE0E;</span></div><div class="run-all-btn btn">all</div></div><div class="status">running...</div></div><div class="output-div"></div></div><ol>
<li><a href="#linux%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E7%B1%BB">Linux&#x57FA;&#x7840;&#x77E5;&#x8BC6;&#x7C7B;</a>
<ol>
<li><a href="#halt%E5%81%9C%E6%AD%A2%E5%92%8Cpoweroff%E5%85%B3%E9%97%AD%E7%94%B5%E6%BA%90%E7%9A%84%E5%8C%BA%E5%88%AB%E6%98%AF%E4%BB%80%E4%B9%88">halt&#xFF08;&#x505C;&#x6B62;&#xFF09;&#x548C;poweroff&#xFF08;&#x5173;&#x95ED;&#x7535;&#x6E90;&#xFF09;&#x7684;&#x533A;&#x522B;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</a></li>
<li><a href="#terminal%E7%BB%88%E7%AB%AF-cli%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%95%8C%E9%9D%A2-shell-tty%E7%94%B5%E4%BC%A0%E6%89%93%E5%AD%97%E6%9C%BA%E5%92%8Cconsole%E6%8E%A7%E5%88%B6%E5%8F%B0%E7%9A%84%E5%8C%BA%E5%88%AB%E6%98%AF%E4%BB%80%E4%B9%88">Terminal&#xFF08;&#x7EC8;&#x7AEF;&#xFF09;&#x3001;CLI&#xFF08;&#x547D;&#x4EE4;&#x884C;&#x754C;&#x9762;&#xFF09;&#x3001;Shell&#x3001;TTY&#xFF08;&#x7535;&#x4F20;&#x6253;&#x5B57;&#x673A;&#xFF09;&#x548C;Console&#xFF08;&#x63A7;&#x5236;&#x53F0;&#xFF09;&#x7684;&#x533A;&#x522B;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</a></li>
<li><a href="#%E5%91%BD%E4%BB%A4wwhowhoamiwho-am-i%E7%9A%84%E5%8C%BA%E5%88%AB%E6%98%AF%E4%BB%80%E4%B9%88">&#x547D;&#x4EE4;w&#xFF0C;who&#xFF0C;whoami&#xFF0C;who am i&#x7684;&#x533A;&#x522B;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</a></li>
<li><a href="#linux%E5%AD%97%E7%AC%A6%E7%95%8C%E9%9D%A2%E4%B8%8B%E5%A6%82%E4%BD%95%E7%BF%BB%E5%B1%8F">Linux&#x5B57;&#x7B26;&#x754C;&#x9762;&#x4E0B;&#x5982;&#x4F55;&#x7FFB;&#x5C4F;&#xFF1F;</a></li>
</ol>
</li>
<li><a href="#centos%E4%BD%BF%E7%94%A8%E7%B1%BB">CentOS&#x4F7F;&#x7528;&#x7C7B;</a>
<ol>
<li><a href="#centos-7%E5%BF%98%E8%AE%B0root%E5%AF%86%E7%A0%81%E6%80%8E%E4%B9%88%E5%8A%9E">CentOS 7&#x5FD8;&#x8BB0;root&#x5BC6;&#x7801;&#xFF0C;&#x600E;&#x4E48;&#x529E;&#xFF1F;</a>
<ol>
<li><a href="#%E6%96%B9%E6%B3%9501-emergency-mode">&#x65B9;&#x6CD5;01&#xFF1A; emergency mode</a></li>
<li><a href="#%E6%96%B9%E6%B3%9502-single-user-mode">&#x65B9;&#x6CD5;02&#xFF1A; single user mode</a></li>
</ol>
</li>
</ol>
</li>
<li><a href="#centos%E6%95%85%E9%9A%9C%E7%B1%BB">CentOS&#x6545;&#x969C;&#x7C7B;</a>
<ol>
<li><a href="#centos-7-yum%E6%97%B6%E5%87%BA%E7%8E%B0could-not-resolve-host-mirrorlistcentosorg-unknown-error%E9%94%99%E8%AF%AF">CentOS 7 yum&#x65F6;&#x51FA;&#x73B0;&#x201C;Could not resolve host: mirrorlist.centos.org: Unknown error&#x201D;&#x9519;&#x8BEF;</a>
<ol>
<li><a href="#%E6%95%85%E9%9A%9C%E5%88%86%E6%9E%90%E5%AE%9A%E4%BD%8D">&#x6545;&#x969C;&#x5206;&#x6790;&#x5B9A;&#x4F4D;</a></li>
<li><a href="#%E6%95%85%E9%9A%9C%E8%A7%A3%E5%86%B3-%E7%BD%91%E7%BB%9C%E4%B8%8D%E9%80%9A">&#x6545;&#x969C;&#x89E3;&#x51B3; - &#x7F51;&#x7EDC;&#x4E0D;&#x901A;</a></li>
</ol>
</li>
</ol>
</li>
</ol>
<h2 class="mume-header" id="linux%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E7%B1%BB">Linux&#x57FA;&#x7840;&#x77E5;&#x8BC6;&#x7C7B;</h2>

<h3 class="mume-header" id="halt%E5%81%9C%E6%AD%A2%E5%92%8Cpoweroff%E5%85%B3%E9%97%AD%E7%94%B5%E6%BA%90%E7%9A%84%E5%8C%BA%E5%88%AB%E6%98%AF%E4%BB%80%E4%B9%88">halt&#xFF08;&#x505C;&#x6B62;&#xFF09;&#x548C;poweroff&#xFF08;&#x5173;&#x95ED;&#x7535;&#x6E90;&#xFF09;&#x7684;&#x533A;&#x522B;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</h3>

<ol>
<li>&#x65E0;<code>ACPI(Advanced Configuration and Power Management Interface)</code>&#x7684;&#x7CFB;&#x7EDF;&#x4E0A;&#xFF1A;
<ul>
<li>halt&#x5173;&#x95ED;<code>OS</code>&#xFF0C;&#x4F46;&#x6CA1;&#x6709;&#x5173;&#x95ED;&#x7535;&#x6E90;&#xFF0C;&#x9700;&#x8981;&#x624B;&#x52A8;&#x518D;&#x6309;&#x4E0B;&quot;&#x5173;&#x673A;&quot;&#x6309;&#x94AE;&#x5173;&#x95ED;&#x7535;&#x6E90;</li>
<li>poweroff&#x540C;&#x65F6;&#x5173;&#x95ED;<code>OS</code>&#x548C;&#x7535;&#x6E90;</li>
</ul>
</li>
<li>&#x6709;<code>ACPI</code>&#x7684;&#x7CFB;&#x7EDF;&#x4E0A;&#xFF1A; &#x6CA1;&#x6709;&#x533A;&#x522B;</li>
</ol>
<h3 class="mume-header" id="terminal%E7%BB%88%E7%AB%AF-cli%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%95%8C%E9%9D%A2-shell-tty%E7%94%B5%E4%BC%A0%E6%89%93%E5%AD%97%E6%9C%BA%E5%92%8Cconsole%E6%8E%A7%E5%88%B6%E5%8F%B0%E7%9A%84%E5%8C%BA%E5%88%AB%E6%98%AF%E4%BB%80%E4%B9%88">Terminal&#xFF08;&#x7EC8;&#x7AEF;&#xFF09;&#x3001;CLI&#xFF08;&#x547D;&#x4EE4;&#x884C;&#x754C;&#x9762;&#xFF09;&#x3001;Shell&#x3001;TTY&#xFF08;&#x7535;&#x4F20;&#x6253;&#x5B57;&#x673A;&#xFF09;&#x548C;Console&#xFF08;&#x63A7;&#x5236;&#x53F0;&#xFF09;&#x7684;&#x533A;&#x522B;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</h3>

<ol>
<li><code>CLI</code>&#xFF1A; &#x4F7F;&#x7528;&#x6587;&#x672C;&#x547D;&#x4EE4;&#x8FDB;&#x884C;&#x4EA4;&#x4E92;&#x7684;&#x7528;&#x6237;&#x754C;&#x9762;</li>
<li><code>Shell</code>&#xFF1A; &#x4E00;&#x79CD;<code>CLI</code>&#x89E3;&#x91CA;&#x5668;</li>
<li><code>Terminal</code> == <code>TTY</code>&#xFF1A; &#x4E00;&#x79CD;&#x6587;&#x672C;&#x8F93;&#x5165;&#x8F93;&#x51FA;&#x73AF;&#x5883;&#xFF0C;&#x901A;&#x8FC7;&#x4E32;&#x884C;&#x7EBF;&#x7528;&#x6253;&#x5370;&#x673A;&#x952E;&#x76D8;&#x901A;&#x8FC7;&#x9605;&#x8BFB;&#x548C;&#x53D1;&#x9001;&#x4FE1;&#x606F;&#x7684;&#x8BBE;&#x5907;
<ol>
<li><code>PTY(Pseudo-TTY)</code>&#xFF1A; &#x865A;&#x62DF;<code>TTY</code>&#xFF0C;&#x8FDC;&#x7A0B;&#x767B;&#x5F55;&#x6216;&#x5728;<code>GUI</code>&#x73AF;&#x5883;&#x4E0B;&#x6253;&#x5F00;<code>terminal</code>&#xFF0C;<code>PTY</code>&#x7531;<code>PTMX</code>&#x548C;<code>PTS</code>&#x7EC4;&#x6210;
<ol>
<li><code>PTMX(Pseudo-Terminal Master)</code></li>
<li><code>PTS(Pseudo-Terminal Slave)</code></li>
</ol>
</li>
</ol>
</li>
<li><code>Console</code>&#xFF1A; &#x4E00;&#x79CD;&#x7279;&#x6B8A;&#x7684;<code>Terminal</code>&#xFF08;&#x8F93;&#x5165;&#x8F93;&#x51FA;&#x73AF;&#x5883;&#x4E0E;&#x4E3B;&#x673A;&#x4E00;&#x4F53;&#xFF09;&#xFF0C;&#x65E9;&#x671F;&#x4E3A;&#x7CFB;&#x7EDF;&#x7BA1;&#x7406;&#x5458;&#x4E13;&#x7528;&#x7684;&#x4E00;&#x79CD;<code>Terminal</code>&#xFF0C;&#x73B0;&#x5728;&#x57FA;&#x672C;&#x4E0E;<code>Terminal</code>&#x4EE3;&#x8868;&#x540C;&#x4E00;&#x4E2A;&#x4E8B;&#x7269;</li>
</ol>
<p>&#x5373;&#xFF1A;<code>CLI</code>&#x662F;&#x4E00;&#x79CD;&#x7528;&#x6237;&#x754C;&#x9762;&#xFF0C;<code>Shell</code>&#x662F;&#x4E00;&#x79CD;&#x5B9E;&#x73B0;<code>CLI</code>&#x7684;&#x8F6F;&#x4EF6;&#xFF0C;<code>Terminal</code>/<code>TTY</code>/<code>Console</code>&#x5728;<code>Shell</code>&#x548C;&#x7528;&#x6237;&#x4E4B;&#x95F4;&#x8D1F;&#x8D23;&#x8F93;&#x5165;/&#x8F93;&#x51FA;&#x7684;&#x786C;&#x4EF6;&#x6216;&#x8F6F;&#x4EF6;&#x6A21;&#x62DF;&#x5668;</p>
<p>&#x66F4;&#x8BE6;&#x7EC6;&#x8BF7;&#x53C2;&#x89C1;&#xFF1A;</p>
<ol>
<li><a href="https://printempw.github.io/the-difference-between-cli-terminal-shell-tty/">https://printempw.github.io/the-difference-between-cli-terminal-shell-tty/</a></li>
<li><a href="https://unix.stackexchange.com/a/358493">https://unix.stackexchange.com/a/358493</a></li>
<li><a href="http://www.freeoa.net/osuport/intronix/linux-tty-ptys-console_3316.html">http://www.freeoa.net/osuport/intronix/linux-tty-ptys-console_3316.html</a></li>
<li><a href="https://www.zhihu.com/question/21711307/answer/56056972">https://www.zhihu.com/question/21711307/answer/56056972</a></li>
<li><a href="https://www.cnblogs.com/liqiuhao/p/9031803.html">https://www.cnblogs.com/liqiuhao/p/9031803.html</a></li>
<li><a href="https://segmentfault.com/a/1190000009082089">https://segmentfault.com/a/1190000009082089</a></li>
</ol>
<h3 class="mume-header" id="%E5%91%BD%E4%BB%A4wwhowhoamiwho-am-i%E7%9A%84%E5%8C%BA%E5%88%AB%E6%98%AF%E4%BB%80%E4%B9%88">&#x547D;&#x4EE4;w&#xFF0C;who&#xFF0C;whoami&#xFF0C;who am i&#x7684;&#x533A;&#x522B;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</h3>

<ol>
<li><code>w</code>: show who is logged on in system and what they are doing</li>
<li><code>who</code>: show who is logged on in system</li>
<li><code>whoami</code>: show effective userid who logged on in current tty</li>
<li><code>who am i</code>: print logged userid</li>
</ol>
<p>&#x5047;&#x8BBE;&#x7528;&#x6237;&#x4EE5;<code>abc</code>&#x8D26;&#x53F7;&#x767B;&#x5F55;&#x5E76;<code>su</code>&#x5230;<code>root</code>&#x8D26;&#x53F7;&#x65F6;&#xFF0C;<code>whoami</code>&#x5C06;&#x663E;&#x793A;<code>root</code>&#xFF0C;<code>who am i</code>&#x5C06;&#x663E;&#x793A;<code>abc</code>&#x3002;</p>
<h3 class="mume-header" id="linux%E5%AD%97%E7%AC%A6%E7%95%8C%E9%9D%A2%E4%B8%8B%E5%A6%82%E4%BD%95%E7%BF%BB%E5%B1%8F">Linux&#x5B57;&#x7B26;&#x754C;&#x9762;&#x4E0B;&#x5982;&#x4F55;&#x7FFB;&#x5C4F;&#xFF1F;</h3>

<p><code>Linux</code>&#x5B57;&#x7B26;&#x754C;&#x9762;&#x4E0B;&#x4E00;&#x822C;&#x4E0D;&#x76F4;&#x63A5;&#x8FDB;&#x884C;&#x7FFB;&#x5C4F;&#xFF0C;&#x800C;&#x662F;&#x4F7F;&#x7528;<code>more</code>&#x3001;<code>less</code>&#x4E4B;&#x7C7B;&#x652F;&#x6301;&#x7FFB;&#x5C4F;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x5982;&#x679C;&#x786E;&#x5B9E;&#x9700;&#x8981;&#x7FFB;&#x5C4F;&#x4F7F;&#x7528;<code>&lt;SHIFT&gt; + &lt;PageUp&gt;</code>&#x5411;&#x4E0A;&#x7FFB;&#x5C4F;&#xFF0C;<code>&lt;SHIFT&gt; + &lt;PageDown&gt;</code>&#x5411;&#x4E0B;&#x7FFB;&#x5C4F;&#xFF0C;<strong>&#x4F46;&#x80FD;&#x7FFB;&#x5C4F;&#x7684;&#x8303;&#x56F4;&#x5F88;&#x5C0F;</strong>&#x3002;</p>
<h2 class="mume-header" id="centos%E4%BD%BF%E7%94%A8%E7%B1%BB">CentOS&#x4F7F;&#x7528;&#x7C7B;</h2>

<h3 class="mume-header" id="centos-7%E5%BF%98%E8%AE%B0root%E5%AF%86%E7%A0%81%E6%80%8E%E4%B9%88%E5%8A%9E">CentOS 7&#x5FD8;&#x8BB0;root&#x5BC6;&#x7801;&#xFF0C;&#x600E;&#x4E48;&#x529E;&#xFF1F;</h3>

<h4 class="mume-header" id="%E6%96%B9%E6%B3%9501-emergency-mode">&#x65B9;&#x6CD5;01&#xFF1A; emergency mode</h4>

<p><img src="./assets_image/F01_startup.png" alt></p>
<p><img src="./assets_image/F02_edit.png" alt></p>
<p><img src="./assets_image/F03_edit.png" alt></p>
<p><img src="./assets_image/F04_passwd.png" alt></p>
<p>&#x53C2;&#x8003;&#x81EA;&#xFF1A; <a href="https://blog.51cto.com/jschu/1706020">https://blog.51cto.com/jschu/1706020</a></p>
<h4 class="mume-header" id="%E6%96%B9%E6%B3%9502-single-user-mode">&#x65B9;&#x6CD5;02&#xFF1A; single user mode</h4>

<p>&#x8BF7;&#x53C2;&#x8003;&#xFF1A; <a href="https://blog.csdn.net/ywd1992/article/details/83538730">https://blog.csdn.net/ywd1992/article/details/83538730</a></p>
<h2 class="mume-header" id="centos%E6%95%85%E9%9A%9C%E7%B1%BB">CentOS&#x6545;&#x969C;&#x7C7B;</h2>

<h3 class="mume-header" id="centos-7-yum%E6%97%B6%E5%87%BA%E7%8E%B0could-not-resolve-host-mirrorlistcentosorg-unknown-error%E9%94%99%E8%AF%AF">CentOS 7 yum&#x65F6;&#x51FA;&#x73B0;&#x201C;Could not resolve host: <a href="http://mirrorlist.centos.org">mirrorlist.centos.org</a>: Unknown error&#x201D;&#x9519;&#x8BEF;</h3>

<p>&#x1F449; <strong>&#x9E23;&#x8C22;</strong>&#xFF1A; &#x6B64;&#x6545;&#x969C;&#x5206;&#x6790;&#x5B9A;&#x4F4D;&#x4E0E;&#x89E3;&#x51B3;&#x6765;&#x81EA;&#x4E8E;<code>gitee</code>&#x7528;&#x6237;@Grade_Harry&#x53D1;&#x51FA;&#x7684;<a href="https://gitee.com/aroming/course_os/issues/I1G6GR"><code>issue #I1G6GR</code></a>&#xFF0C;#I1G6GR</p>
<p><img src="./assets_image/could_not_resolve_host_mirrorlist.jpg" alt></p>
<ol>
<li>&#x6545;&#x969C;&#x573A;&#x666F;
<ol>
<li>&#x673A;&#x5668;&#x8BBE;&#x5907;&#xFF1A; <code>VirtualBox</code>&#x865A;&#x62DF;&#x673A;</li>
<li><code>Guest OS</code>&#xFF1A; <code>CentOS 7 minimal</code></li>
<li>&#x5176;&#x4ED6;&#x63CF;&#x8FF0;&#xFF1A; &#x9ED8;&#x8BA4;&#x5B89;&#x88C5;<code>CentOS 7 minimal</code>&#x540E;&#x6CA1;&#x6709;&#x6267;&#x884C;&#x8FC7;<code>yum</code>&#x3001;&#x6CA1;&#x6709;&#x5B89;&#x88C5;&#x5176;&#x4ED6;&#x8F6F;&#x4EF6;&#x3001;&#x6CA1;&#x6709;&#x8FDB;&#x884C;&#x7CFB;&#x7EDF;&#x8BBE;&#x7F6E;&#x66F4;&#x6539;</li>
<li>&#x767B;&#x5F55;&#x8D26;&#x53F7;&#xFF1A; <code>root</code></li>
</ol>
</li>
</ol>
<h4 class="mume-header" id="%E6%95%85%E9%9A%9C%E5%88%86%E6%9E%90%E5%AE%9A%E4%BD%8D">&#x6545;&#x969C;&#x5206;&#x6790;&#x5B9A;&#x4F4D;</h4>

<p>&#x53EF;&#x80FD;&#x7684;&#x6545;&#x969C;&#x539F;&#x56E0;&#xFF1A;</p>
<ol>
<li><code>Guest OS</code>&#x7F51;&#x7EDC;&#x4E0D;&#x901A;</li>
<li><code>DNS</code>&#x65E0;&#x6CD5;&#x8BBF;&#x95EE;</li>
<li><code>mirrorlist.centos.org</code>&#x670D;&#x52A1;&#x5668;&#x65E0;&#x6CD5;&#x8BBF;&#x95EE;</li>
</ol>
<p>&#x7ECF;<code>ping www.baidu.com</code>&#x5931;&#x8D25;&#xFF0C;&#x5B9A;&#x4F4D;&#x4E8E;<code>Guest OS</code>&#x7F51;&#x7EDC;&#x4E0D;&#x901A;&#xFF0C;&#x8FDB;&#x4E00;&#x6B65;&#x8FD0;&#x884C;<code>ip addr</code>&#x53D1;&#x73B0;&#x865A;&#x62DF;&#x7F51;&#x5361;&#x65E0;<code>ip address</code>&#xFF0C;&#x7ECF;<code>cat /etc/sysconfig/network-scripts/ifcfg-enp0s3</code>&#xFF08;&#x4E0D;&#x540C;&#x673A;&#x5668;&#x7684;&#x865A;&#x62DF;&#x7F51;&#x5361;&#x540D;&#x79F0;&#x53EF;&#x80FD;&#x4E0D;&#x4E00;&#x6837;&#xFF09;&#x53D1;&#x73B0;<code>ONBOOT=no</code></p>
<p>&#x26A0;&#xFE0F; &#x26A0;&#xFE0F; &#x26A0;&#xFE0F; &#x5B9E;&#x9645;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x4E5F;&#x6709;&#x53EF;&#x80FD;&#x7531;&#x4E8E;<code>DNS</code>&#x65E0;&#x6CD5;&#x8BBF;&#x95EE;&#x6216;<code>mirrorlist.centos.org</code>&#x670D;&#x52A1;&#x5668;&#x65E0;&#x6CD5;&#x8BBF;&#x95EE;&#x5BFC;&#x81F4;&#x6B64;&#x6545;&#x969C;&#xFF0C;&#x5982;&#x662F;&#x7531;&#x4E8E;&#x6B64;&#x4E24;&#x7C7B;&#x539F;&#x56E0;&#xFF0C;&#x8BF7;&#x53E6;&#x5206;&#x6790;&#x4E0E;&#x5B9A;&#x4F4D;&#x3002;</p>
<h4 class="mume-header" id="%E6%95%85%E9%9A%9C%E8%A7%A3%E5%86%B3-%E7%BD%91%E7%BB%9C%E4%B8%8D%E9%80%9A">&#x6545;&#x969C;&#x89E3;&#x51B3; - &#x7F51;&#x7EDC;&#x4E0D;&#x901A;</h4>

<ol>
<li>&#x8FD0;&#x884C;<code>vi /etc/sysconfig/network-scripts/ifcfg-enp0s3</code>&#xFF08;&#x4E0D;&#x540C;&#x673A;&#x5668;&#x7684;&#x865A;&#x62DF;&#x7F51;&#x5361;&#x540D;&#x79F0;&#x53EF;&#x80FD;&#x4E0D;&#x4E00;&#x6837;&#xFF09;&#xFF0C;&#x5C06;<code>ONBOOT=no</code>&#x4FEE;&#x6539;&#x4E3A;<code>ONBOOT=yes</code>&#xFF0C;&#x5177;&#x4F53;&#x6B65;&#x9AA4;&#x5982;&#x4E0B;&#xFF1A;
<ol>
<li>&#x5C06;&#x5149;&#x6807;&#x79FB;&#x81F3;<code>ONBOOT=no</code></li>
<li>&#x6309;&#x4E0B;<code>&lt;a&gt;</code>&#x952E;&#x6216;<code>&lt;i&gt;</code>&#x952E;&#x8FDB;&#x5165;&#x7F16;&#x8F91;&#x6A21;&#x5F0F;</li>
<li>&#x5C06;<code>ONBOOT=no</code>&#x4FEE;&#x6539;&#x4E3A;<code>ONBOOT=yes</code></li>
<li>&#x6309;&#x4E0B;<code>&lt;ESC&gt;</code>&#x952E;&#x9000;&#x51FA;&#x7F16;&#x8F91;&#x6A21;&#x5F0F;</li>
<li>&#x8F93;&#x5165;<code>:wq</code>&#x9000;&#x51FA;&#x5E76;&#x4FDD;&#x5B58;&#x6587;&#x4EF6;</li>
</ol>
</li>
<li>&#x8FD0;&#x884C;<code>service network restart</code></li>
</ol>

      </div>
      
      
    
    
    
    
    
    
    
    
  
    </body></html>